package com.qfedu.dao;

import com.qfedu.entity.Address;
import com.qfedu.entity.User;

import java.sql.SQLException;
import java.util.List;

public interface AddressDao {
    /**
     * 按照用户的uid 查询所有地址信息
     * @param uid
     * @return
     * @throws SQLException
     */

    List<Address> findAddressById(int uid) throws SQLException;

    /**
     * 添加一条地址数据
     * @param address
     * @return
     * @throws SQLException
     */
    int addAddress(Address address) throws SQLException;

    /**
     * 修改地址信息
     * @param //updateAddress
     * @return
     * @throws SQLException
     */
    int updateAddress(Address address) throws SQLException;

    /**
     * 根据id 删除一个地址
     * @param aid
     * @return
     * @throws SQLException
     */
    int deleteAddress(int aid) throws SQLException;

    /**
     * 根据id 修改默认地址
     * @param aid
     * @return
     * @throws SQLException
     */
    int defaultAddr(int aid) throws SQLException;
    int emptyDefault(int uid)throws SQLException;
}
